Automated watering system

Published in Electronics

Lately I have had the chance to finish a Photon based control board designed to control 24 volt AC solenoids used in irrigation systems. Going through the process of developing this board was a bit of a learning experience, but produced a working system in the end. First a quick rundown of the board. The heart of the board is naturally the Photon Internet connected microcontroller, paired with Jaycar’s arduino compatible real time clock. Although the Photon does have a real time clock on board and has a battery connection to keep it ticking, Jaycar’s clock module has 32 kB of battery backed storage. This storage will be very useful for storing watering program information, weather forecast and history data, and any outgoing messages that had to be queued. Control of the solenoids is through solid state relays which are in turn controlled by NPN transistors, and indicator LEDs are in series. The array of resistors wound up being bypassed in the end. On the right side of the board is an input for the 24 volt AC power supply, while on the left is a daughter board with a bridge rectifier and a ”d-sun” buck converter providing a 5.5 volt DC output to drive the control circuits.

Lessons Learned

If there were any lessons to draw from the experience of designing this board, it would be these: don’t underestimate the resistance of even a decent cable, and from that, make sure your test bench matches reality as much as possible! In this case underestimating cable resistance let a lot of complexity enter the design, in the form of extra ballast resistors, the due to concerns of brownouts if the solenoids were connected straight to the small one amp power supply. Each solenoid would happily pull 0.7 amps, while 0.25 amps was all that was required for the solenoid to trigger. So in an effort to allow at least two solenoids to be switched on at once, some in line resistance was added to each channel. After adding heat management for the ballast and doing bench tests with multiple solenoids hooked up through a few metres of light duty hookup wire, the project seemed good to roll. Naturally, it wasn’t. After sorting out the garden side of the project with two garden variety solenoid valves and 0.5mm cored irrigation cable, the first real test of the system failed. Current flowed, but the AC voltage supplied to the valves was far too low – just 11 volts. Adding parallel ballast to allow more current to flow raised the supply to roughly 13 volts. The only way to make the solenoids trigger in the initial field setup was to add a shunt that bypassed the ballast completely. That does however allow the original concern to come to pass – if multiple solenoids are turned on, the system tends to brown out and reset after a minute.

Next steps

At present the software running the system is very basic – future posts will look at the software side of the system, and I’ll probably publish the Photon sketch and web interface to Github down the track. The hardware is capable of some advanced scheduling with occassional Internet connectivity, it just needs the code to do it.

More photos